//----------------------------------------------------------------------------
//  ,-.
// /_\___ ,   Ninja Framework
// '  ___\    (C) Riccardo Capra - http://riccar.do
//  //   \\
//----------------------------------------------------------------------------
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------

#ifndef NJ_FUNDAMENTAL_LIMITS_H
#	define NJ_FUNDAMENTAL_LIMITS_H

#	include "NjNinjaSyncLib.h"
#	include "NjFundamentalTypes.h"

/// \brief The maximum value of NjUint8
static const NjUint8 NJ_MIN_UINT_8=0;

/// \brief The minimum value of NjUint8
static const NjUint8 NJ_MAX_UINT_8=0xFF;

/// \brief The maximum value of NjUint16
static const NjUint16 NJ_MIN_UINT_16=0;

/// \brief The minimum value of NjUint16
static const NjUint16 NJ_MAX_UINT_16=0xFFFF;

/// \brief The maximum value of NjUint32
static const NjUint32 NJ_MIN_UINT_32=0;

/// \brief The minimum value of NjUint32
static const NjUint32 NJ_MAX_UINT_32=0xFFFFFFFFUL;

/// \brief The maximum value of NjUint64
static const NjUint64 NJ_MIN_UINT_64=0;

/// \brief The minimum value of NjUint64
static const NjUint64 NJ_MAX_UINT_64=0xFFFFFFFFFFFFFFFFULL;

/// \brief The maximum value of NjInt8
static const NjInt8 NJ_MIN_INT_8=-0x7F-1;

/// \brief The minimum value of NjInt8
static const NjInt8 NJ_MAX_INT_8=0x7F;

/// \brief The maximum value of NjInt16
static const NjInt16 NJ_MIN_INT_16=-0x7FFF-1;

/// \brief The minimum value of NjInt16
static const NjInt16 NJ_MAX_INT_16=0x7FFF;

/// \brief The maximum value of NjInt32
static const NjInt32 NJ_MIN_INT_32=-0x7FFFFFFFL-1;

/// \brief The minimum value of NjInt32
static const NjInt32 NJ_MAX_INT_32=0x7FFFFFFFL;

/// \brief The maximum value of NjInt64
static const NjInt64 NJ_MIN_INT_64=-0x7FFFFFFFFFFFFFFFLL-1;

/// \brief The minimum value of NjInt64
static const NjInt64 NJ_MAX_INT_64=0x7FFFFFFFFFFFFFFFLL;

/// \var static const NjChar8 NJ_MAX_CHAR_8
/// \brief The maximum value of NjChar8

/// \var static const NjChar8 NJ_MIN_CHAR_8
/// \brief The minimum value of NjChar8

/// \var static const NjChar16 NJ_MAX_CHAR_16
/// \brief The maximum value of NjChar16

/// \var static const NjChar16 NJ_MIN_CHAR_16
/// \brief The minimum value of NjChar16

/// \var static const NjChar32 NJ_MAX_CHAR_32
/// \brief The maximum value of NjChar32

/// \var static const NjChar32 NJ_MIN_CHAR_32
/// \brief The minimum value of NjChar32

/// \var static const NjCharW NJ_MAX_CHAR_W
/// \brief The maximum value of NjCharW

/// \var static const NjCharW NJ_MIN_CHAR_W
/// \brief The minimum value of NjCharW

#	if NJ_TYPES_CHAR_8_IS_SIGNED
	static const NjChar8 NJ_MAX_CHAR_8=NjChar8(0x7F);
	static const NjChar8 NJ_MIN_CHAR_8=-NJ_MAX_CHAR_8-1;
#	else // NJ_TYPES_CHAR_8_IS_SIGNED
	static const NjChar8 NJ_MIN_CHAR_8=NjChar8(0x00);
	static const NjChar8 NJ_MAX_CHAR_8=NjChar8(0xFF);
#	endif // NJ_TYPES_CHAR_8_IS_SIGNED

	/// \brief The maximum value of NjChar
	static const NjChar NJ_MAX_CHAR=NJ_MAX_CHAR_8;

	/// \brief The minimum value of NjChar
	static const NjChar NJ_MIN_CHAR=NJ_MIN_CHAR_8;

#	if NJ_TYPES_CHAR_16_IS_SIGNED
	static const NjChar16 NJ_MAX_CHAR_16=NjChar16(0x7FFF);
	static const NjChar16 NJ_MIN_CHAR_16=-NJ_MAX_CHAR_16-1;
#	else // NJ_TYPES_CHAR_16_IS_SIGNED
	static const NjChar16 NJ_MIN_CHAR_16=NjChar16(0x0000);
	static const NjChar16 NJ_MAX_CHAR_16=NjChar16(0xFFFF);
#	endif // NJ_TYPES_CHAR_16_IS_SIGNED

#	if NJ_TYPES_CHAR_32_IS_SIGNED
	static const NjChar32 NJ_MAX_CHAR_32=NjChar32(0x7FFFFFFF);
	static const NjChar32 NJ_MIN_CHAR_32=-NJ_MAX_CHAR_32-1;
#	else // NJ_TYPES_CHAR_32_IS_SIGNED
	static const NjChar32 NJ_MIN_CHAR_32=NjChar32(0x00000000);
	static const NjChar32 NJ_MAX_CHAR_32=NjChar32(0xFFFFFFFF);
#	endif // NJ_TYPES_CHAR_32_IS_SIGNED

#	if NJ_TYPES_CHAR_W_IS_16
	static const NjCharW NJ_MAX_CHAR_W=NJ_MAX_CHAR_16;
	static const NjCharW NJ_MIN_CHAR_W=NJ_MIN_CHAR_16;
#	else // NJ_TYPES_CHAR_W_IS_16
	static const NjCharW NJ_MAX_CHAR_W=NJ_MAX_CHAR_32;
	static const NjCharW NJ_MIN_CHAR_W=NJ_MIN_CHAR_32;
#	endif // NJ_TYPES_CHAR_W_IS_16

/// \brief The hash value of zero lenght string
static const NjHashType EMPTY_HASH=0;

/// \var static const NjUint NJ_MAX_UINT
/// \brief The minimum value of NjUint

/// \var static const NjUint NJ_MIN_UINT
/// \brief The minimum value of NjUint

/// \var static const NjInt NJ_MAX_INT
/// \brief The minimum value of NjInt

/// \var static const NjInt NJ_MIN_INT
/// \brief The minimum value of NjInt

#	if NJ_PLATFORM_32_BIT
	static const NjUint NJ_MIN_UINT=NJ_MIN_UINT_32;
	static const NjUint NJ_MAX_UINT=NJ_MAX_UINT_32;

	static const NjInt NJ_MIN_INT=NJ_MIN_INT_32;
	static const NjInt NJ_MAX_INT=NJ_MAX_INT_32;
#	else // NJ_PLATFORM_32_BIT
	static const NjUint NJ_MIN_UINT=NJ_MIN_UINT_64;
	static const NjUint NJ_MAX_UINT=NJ_MAX_UINT_64;

	static const NjInt NJ_MIN_INT=NJ_MIN_INT_64;
	static const NjInt NJ_MAX_INT=NJ_MAX_INT_64;
#	endif // NJ_PLATFORM_32_BIT

#endif // NJ_FUNDAMENTAL_LIMITS_H
